package com.wc.AlgoOJ_train.train1.c6.A612;

import java.util.Scanner;

/**
 * @Author congge
 * @Date 2024/1/10 22:42
 * @description 叠筐
 * http://43.138.190.70:8888/p/A612
 */
public class Main {
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        while (sc.hasNext()) {
            int n = sc.nextInt();
            char[] letter = new char[2];
            letter[0] = sc.next().charAt(0);
            letter[1] = sc.next().charAt(0);
            char[][] map = new char[n][n];
            int mid = n / 2;
            int idx = 0;
            int round = 1;
            while (mid >= 0) {
                int up = mid;
                int left = mid;
                int down = mid + round - 1;
                int right = mid + round - 1;
                // 上下左右涂色
                for (int i = 0; i < round; i++) {
                    map[up][mid + i] = letter[idx];
                    map[down][mid + i] = letter[idx];
                    map[mid + i][left] = letter[idx];
                    map[mid + i][right] = letter[idx];
                }

                round += 2;
                idx ^= 1;
                mid--;
            }
            // 1的时候不要去四周
            if (n != 1) {
                map[0][0] = map[0][n - 1] = map[n - 1][0] = map[n - 1][n - 1] = ' ';
            }
            StringBuffer ans = new StringBuffer();
            for (int i = 0; i < n; i++) {
                ans.append(map[i]);
                ans.append('\n');
            }
            System.out.println(ans);
        }
    }
}
